package com.Map;

import java.util.TreeMap;

public class MapDemo01 {
    public static void main(String[] args) {
        TreeMap<Student,String> hm=new TreeMap<>();
        Student s1 = new Student("xiaopang",21);
        Student s2 = new Student("xiaomei",21);
        Student s3 = new Student("xiaohei",22);
        hm.put(s1,"江苏");
        hm.put(s2,"北京");
        hm.put(s3,"上海");
        hm.forEach((Student key,String value)->{
            System.out.println(key+"---"+value);
        });

    }
}
